package com.jiuzhi.kafka.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;


/**
 *   消息队列
 * @author tangsixiang
 *
 */
@Component
public class ProductUtil {

	@Autowired
	private KafkaTemplate<String,String> kafkaTemplate;
	
	
	
	  /***
	   * 
	   * @param topic  消息发送的主题
	   * @param data  消息主题 建议采用json格式数据字符串
	   */
    public void sendTopicMess(String topic, String data){
           kafkaTemplate.send(topic,data);
    }
    
    
 
}
